package com.appspot.diasporajava.dao.hibernate;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Component;

import com.appspot.diasporajava.dao.PostDao;
import com.appspot.diasporajava.entities.Post;

@Component
public class PostDaoHibernate extends GenericDaoHibernateImpl<Post,Long> implements PostDao<Post,Long>{

	@Override
	public List<Post> findByUserId(Long userId) {
		Query query = getSession().createQuery("from Post where userId=" + userId);
		return query.list();
	}

}
